package com.ybkj.o2o.zhuanche.service.impl;

import com.ybkj.o2o.zhuanche.common.query.OrderRefuseQuery;
import com.ybkj.o2o.zhuanche.entity.OrderRefuse;
import com.ybkj.o2o.zhuanche.entity.OrderRefuseCriteria;
import com.ybkj.o2o.zhuanche.mapper.BaseMapper;
import com.ybkj.o2o.zhuanche.mapper.OrderRefuseMapper;
import com.ybkj.o2o.zhuanche.service.OrderRefuseService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DefaultOrderRefuseService extends
    AbstractBaseService<OrderRefuse, OrderRefuseCriteria, Long> implements OrderRefuseService {

  @Autowired
  private OrderRefuseMapper orderRefuseMapper;

  @Override
  public BaseMapper<OrderRefuse, OrderRefuseCriteria, Long> getMapper() {

    return orderRefuseMapper;
  }

  @Override
  public int insert(OrderRefuse orderRefuse) {
    orderRefuse.setCreated(new Date());
    orderRefuse.setUpdated(new Date());
    return super.insert(orderRefuse);
  }

  @Override
  public int update(OrderRefuse orderRefuse) {
    orderRefuse.setUpdated(new Date());
    return super.update(orderRefuse);
  }

  @Override
  public List<OrderRefuse> findByParam(OrderRefuseQuery orderRefuseQuery) {
    return orderRefuseMapper.findByParam(orderRefuseQuery);
  }

  @Override
  public long countByParam(OrderRefuseQuery orderRefuseQuery) {
    return orderRefuseMapper.countByParam(orderRefuseQuery);
  }

}
